<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<TITLE>Quản lý chỉ mục</TITLE>
	<style>
.item1 {
	background: #015AC3 !important;
}
</style>
</h:head>
<h:body>

	<ui:include src="admin_header.xhtml"></ui:include>
	<h:form>
		<div class="main">
			<p:growl id="msgg"></p:growl>

			<div class="tab-panel">
				<p:outputLabel id="mess" value="#{adminBean.mess}"></p:outputLabel>

				<p:selectBooleanButton value="#{adminBean.roleIndexing}"
					style="margin-left:5px;" onLabel="Bật" offLabel="Tắt"
					onIcon="ui-icon-check" offIcon="ui-icon-close">
					<p:ajax listener="#{adminBean.update}" update="msgg,mess" />
				</p:selectBooleanButton>
				<label style="margin-left: 50px;">Xóa chỉ mục của url hiện
					tại không kết nối được </label>
				<p:commandButton value="Xóa" onclick="dql_formDel.show()"></p:commandButton>
			</div>
			<p:commandLink actionListener="#{adminBean.deleteLog}" update="log">
				<div class="clear-log">
					<img title="Xóa log" src="image/del.png" />
				</div>
			</p:commandLink>
			<div class="div-log">

				<p:poll interval="3" listener="#{adminBean.updateLog}" update="log" />

				<p:inputTextarea id="log" value="#{adminBean.log}" rows="40"
					style="width:100%;border: 1px solid #E8E8E8;"></p:inputTextarea>
			</div>
		</div>
	</h:form>
	<ui:include src="template/footer.xhtml"></ui:include>
	<h:form>
		<p:dialog widgetVar="dql_formDel" styleClass="dial_del" width="300"
			resizable="false" modal="true" closable="false" severity="alert"
			header="Xóa chỉ mục">
			<h:panelGroup>
				<div class="form-feild">
					<label style="margin-left: 56px;">(Xóa những chỉ mục có số
						lần bị lỗi là n)</label>
					<div class="feild-left-large">
						<div class="feild-input">
							<label>Nhập n(*)</label>
							<h:inputText style="width:50px;" value="#{adminBean.vn111}"></h:inputText>
						</div>
					</div>
					<div class="btnINS">
						<p:commandButton value="Xóa"
							actionListener="#{adminBean.deleteIndexNotConect}"
							oncomplete="dql_formDel.hide();alert('Đã xóa thành công!');"></p:commandButton>
						<p:commandButton value="Hủy" onclick="dql_formDel.hide()"></p:commandButton>
					</div>
				</div>
			</h:panelGroup>
		</p:dialog>
	</h:form>
</h:body>
</html>